package com.ruicar.afs.cloud.basic.proceeds.business.controller;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.ruicar.afs.cloud.basic.common.entity.BasicReceiptRecord;
import com.ruicar.afs.cloud.basic.common.service.BasicReceiptRecordService;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author: Lee
 * @date: 2020/5/11 19:39
 * @description: 收据处理controller
 */
@Slf4j
@RestController
@RequestMapping("/receiptInfo")
@AllArgsConstructor
public class ReceiptController {
    private BasicReceiptRecordService basicReceiptRecordService;

    @ApiOperation(value = "根据客户号查询溢缴款信息")
    @PostMapping("/findByCustNoReceiptInfo")
    private IResponse findByCustNoReceiptInfo(@RequestParam("custNo") String custNo){
        List<BasicReceiptRecord> list = basicReceiptRecordService.list(Wrappers.<BasicReceiptRecord>query().lambda().eq(BasicReceiptRecord::getCustNo, custNo));
        return new IResponse().setData(list);
    }

}
